
 function disptime(){ 
	     var time = new Date(); 
	     var hour = time.getHours();
	     var minute = time.getMinutes(); 
	     var second = time.getSeconds();
	     var apm="AM";  
	     if (hour>12)
	     { 
	      hour=hour-12; 
	      apm="PM" ; 
	     } 
	     if (minute < 10)  
	      minute="0"+minute; 
	     if (second < 10) 
	      second="0"+second; 
	     /*设置文本框的内容为当前时间*/ 
	     document.getElementById("myclock").innerHTML=hour+":"+minute+":"+second+" "+apm; 
	     /*设置定时器每隔1秒（1000毫秒），调用函数disptime()执行，刷新时钟显示*/ 
	     var myTime = setTimeout("disptime()",1000); 
     } 
     
     $(function(){
     	//显示当前时间
     	disptime();
     })
   